import React, { Component } from 'react';
import { View, Text, Alert } from 'react-native';
import { Actions } from 'react-native-router-flux';
import styles from './styles';
import Header from './components/header';
import CheckMobile from './components/checkMobile';

export default class Login extends Component {
  submitHandle = values => {
    Alert.alert('表单值', JSON.stringify(values), [{ text: '知道了' }], {
      cancelable: false
    });
    Actions.setPassword({mobile: values.mobile})
  };
  sendHandle = () => {

  };
  render() {
    return (
      <View>
        <Header
          title="找回密码"
          right={
            <Text style={styles.headerRight} onPress={() => Actions.loginWithPassword()}>
              我想起来了, 回去登录
            </Text>
          }
        />
        <View style={styles.content}>
          <CheckMobile
            sendAction={this.sendHandle}
            onSubmit={this.submitHandle}
            submitText="下一步"
          />
        </View>
      </View>
    );
  }
};
